<template>
  <el-table-column :label="coloumnHeader.name" :prop="coloumnHeader.name">
    <template v-for="(item, index) in coloumnHeader.children">
      <tableColumn v-if="item.children && item.children.length" :key="index" :coloumn-header="item"></tableColumn>
      <el-table-column v-else :key="index + 0" :label="item.name" :prop="item.id" :show-overflow-tooltip="true">
        <template slot-scope="{ row }">
          <el-input v-if="row.$isEdit" v-model="row[item.id]" :placeholder="item.name"></el-input>
          <span v-else>{{ row[item.id] }}</span>
        </template>
      </el-table-column>
    </template>
  </el-table-column>
</template>
 
<script>
export default {
  name: "tableColumn",
  props: {
    coloumnHeader: {
      type: Object,
      required: true,
    },
  },
};
</script>
 
<style scoped></style>